package socketdemo5;

import java.io.IOException;
import java.net.*;

public class ClientDemo {
    public static void main(String[] args) throws IOException {
        DatagramSocket ds = new DatagramSocket();

        String s = "广播 hello";
        byte[] bytes = s.getBytes();
        DatagramPacket dp = new DatagramPacket(bytes, bytes.length,
                InetAddress.getByName("255.255.255.255"), 10000);
        ds.send(dp);
        ds.close();
    }
}
